import React, { Component } from 'react';
import { Radio } from 'antd';

class App extends React.Component {
    state = {
        value: this.props.value,
    };

    onChange = e => {
        console.log('radio checked', e.target.value);
        this.setState({
            value: e.target.value,
        });
        this.props.parent.getChildrenMsg(this, this.state.value)
        console.log(this.state.value)
    };


    render() {
        return (
            <Radio.Group onChange={this.onChange}  value={this.state.value}>
                <Radio value={1}>男</Radio>
                <Radio value={2}>女</Radio>
            </Radio.Group>
        );
    }
}

export default App
